<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri='http://java.sun.com/portlet' prefix='portlet'%>
<%@ page import="javax.portlet.*"%>
<%@ page import="java.util.*"%>
<%@ page import="cn.com.chinasoa.course.subscribe.model.*"%>
<%@ page import="cn.com.chinasoa.course.subscribe.util.*"%>
<%@ page import="javax.persistence.*"%>
<%@ page import="com.x4ee.soa.portal.framework.tools.*"%>
<%String contextPath = request.getContextPath();%>
<portlet:defineObjects />
<form method='post' action='<portlet:actionURL><portlet:param name="frameworkUri" value="trainingAddressOperateAction"/><portlet:param name="cmd" value="edit"/></portlet:actionURL>'>

<table>
	<tr>
		<td valign="top">
			<table>
				<tr><td><a href='<portlet:renderURL portletMode="EDIT"><portlet:param name="frameworkUri" value="EditIndex"/></portlet:renderURL>'>[发布课程]</a></td></tr>
				<tr><td><a href='<portlet:renderURL portletMode="HELP"><portlet:param name="frameworkUri" value="TrainingSubjectCreate"/></portlet:renderURL>'>[授课科目]</a></td></tr>				
				<tr><td><a href='<portlet:renderURL portletMode="HELP"><portlet:param name="frameworkUri" value="TrainingAddressCreate"/></portlet:renderURL>'>[授课地点]</a></td></tr>
				<tr><td><a href='<portlet:renderURL portletMode="HELP"><portlet:param name="frameworkUri" value="PrivilegeStrategyCreate"/></portlet:renderURL>'>[优惠策略]</a></td></tr>				
				<tr><td><a href='<portlet:renderURL portletMode="EDIT"><portlet:param name="frameworkUri" value="SubscribeOrderView"/></portlet:renderURL>'>[处理订单]</a></td></tr>				
			</table>
		</td>
		<td>
			<table>
			<%long trainingAddressId = DataTypeUtil.parseLong(renderRequest.getParameter("trainingAddressId"));
					EntityManager em = EntityManagerHelper.getEntityManager();
					if(trainingAddressId>=0){
						TrainingAddress tta = em.find(TrainingAddress.class,trainingAddressId);
						if(tta!=null){%>
					<input name="trainingAddressId" type="hidden" value="<%=trainingAddressId%>"/>				
		<tr><th colspan="2" align="left" style="font-size: 13">修改授课地点</th></tr>
<tr><td colspan="2"><table><tr><td align="left">授课城市:</td><td><input name="city" type="text" size="10" class="textfield" value="<%=tta.getCity()%>"/></td></tr></table></td></tr>
<tr><td colspan="2"><table><tr><td align="left">授课地址:</td><td><input name="address" type="text" size="20" class="textfield"  value="<%=tta.getAddress()%>"/></td></tr></table></td></tr>
<tr><td colspan="2"><table><tr><td align="left">交通信息:</td><td><input name="trafficInfo" type="text" size="20" class="textfield"  value="<%=tta.getTrafficInfo()%>"/></td></tr></table></td></tr>
<tr><td colspan="2"><table><tr><td align="left">学员容量:</td><td><input name="capacity" type="text" size="10" class="textfield"  value="<%=tta.getCapacity()%>"/>&nbsp;人</td></tr></table></td></tr>
<tr><td colspan="2"><table><tr><td align="left"><input type="image" src="<%=contextPath%><%=ConfigUtils.getResourceBasePath(renderRequest)%>/image/order.jpg" name="Submit" value="增加">
		<a href="<portlet:renderURL><portlet:param name="frameworkUri" value="SubscribeOrderQuery"/></portlet:renderURL>"><img border="0" src="<%=contextPath%><%=ConfigUtils.getResourceBasePath(renderRequest)%>/image/query.jpg"/></td></tr></table></td></tr>
				<%}}EntityManagerHelper.closeEntityManager();%>
			</table>
		</td>
		<td valign="top">
			<table border="1">
			<tr><td>授课城市</td><td>培训地点</td><td>交通信息</td><td>座席数量</td></tr>
			<%List<TrainingAddress> taList = ModelEntityHelper.listTrainingAddress();
			for(Iterator<TrainingAddress> taIt = taList.iterator();taIt.hasNext();){
				TrainingAddress ta = taIt.next();%>
				<tr><td><strong><%=ta.getCity()%></strong></td>
				<td><a title="<%=ta.getTrafficInfo()%>"><%=ta.getAddress()%></a></td>
				<td align="center"><strong><%=ta.getCapacity()%></strong></td>
				<td><a href="<portlet:renderURL><portlet:param name="frameworkUri" value="TrainingAddressEdit"/><portlet:param name="trainingAddressId" value="<%=ta.getId()+""%>"/></portlet:renderURL>">[编辑]</a>
				<a href="<portlet:actionURL><portlet:param name="frameworkUri" value="trainingAddressOperateAction"/><portlet:param name="trainingAddressId" value="<%=ta.getId()+""%>"/><portlet:param name="cmd" value="delete"/></portlet:actionURL>">[删除]</a></td></tr><%
			}%>
			</table>
		</td>
	</tr>
</table>
</form>	
